package com.spi.soconversion.base.definition;

import java.math.BigDecimal;

import com.spi.soconversion.util.SOCConstants;
import com.spi.soconversion.util.SOCUtility;
import com.spi.soconversion.util.XMLAttributeConstants;
import com.spi.soconversion.util.XMLTagConstants;

public class SOCHeaderCharge {
	
	private String chargeCategory = SOCConstants.ALLOWANCE;
	private BigDecimal chargeAmount;
	private String chargeName;

	public String getChargeName() {
		return chargeName;
	}

	public void setChargeName(String chargeName) {
		this.chargeName = chargeName;
	}

	public String getChargeCategory() {
		return chargeCategory;
	}

	public void setChargeAmount(BigDecimal chargeAmount) {
		this.chargeAmount = chargeAmount;
	}

	public BigDecimal getChargeAmount() {
		return chargeAmount;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();

		sb.append(XMLTagConstants.START_TAG_HEADER_CHARGE);
		sb.append(SOCConstants.BLANK_STRING);
					
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.CHARGE_CATEGORY, getChargeCategory()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.CHARGE_NAME,getChargeName()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.CHARGE_AMT,getChargeAmount().toString()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCConstants.CLOSING_XML_TAG);
		sb.append(SOCConstants.NEW_LINE);

		sb.append(XMLTagConstants.END_TAG_HEADER_CHARGE);

		return sb.toString();
	}
}
